package com.google.code.cakedroid.appdata;

import java.util.ArrayList;
import java.util.List;

/**
 *XMLParse Variable 
 *@author androidyue
 *Last Modified:2011-12-15 	
 */
public class XMLParseVariables {
	private static List<String> xmlNodes=null;
	private static List<String> repetitiousNodes=null;
	private static List<String> renewNodes=null;
	private static int defaultOffset=0;
	
	/**
	 * get xml nodes 
	 * @return  xml nodes
	 */
	public static List<String> getXMLNodes(){
		//lazy instantiate
		if(null==xmlNodes){
			xmlNodes=new ArrayList<String>();
			xmlNodes.add(XMLParseConstants.APP_NAME_NODE);
			xmlNodes.add(XMLParseConstants.NEW_VERSION_NODE);
			xmlNodes.add(XMLParseConstants.PUBLISH_TIME_NODE);
			xmlNodes.add(XMLParseConstants.SUMMARY_NODE);
			xmlNodes.add(XMLParseConstants.SUPPORT_OS_NODE);
			xmlNodes.add(XMLParseConstants.FILE_SIZE_NODE);
			xmlNodes.add(XMLParseConstants.FEATURE_NODE);
		}
		return xmlNodes;
	}
	
	
	/**
	 * get xml node that are repetitious
	 * @return  repetitious nodes
	 */
	public static List<String> getRepetitiousNodes(){
		if(null==repetitiousNodes){
			repetitiousNodes=new ArrayList<String>();
			repetitiousNodes.add(XMLParseConstants.FEATURE_NODE);
		}
		return repetitiousNodes;
	}
	
	/**
	 * get nodes where subresult needs to be renewed.
	 * @return renew nodes
	 */
	public static List<String> getRenewNodes(){
		if(null==renewNodes){
			renewNodes=new ArrayList<String>();
			renewNodes.add(XMLParseConstants.UPGRADE_NODE);
		}
		return renewNodes;
	}
	
	/**
	 * get default offset
	 * @return
	 */
	public static int getDefaultOffset(){
		return defaultOffset;
	}
}
